package www.yfz.service;

import java.util.List;

import com.mysql.jdbc.StringUtils;

import www.yfz.dao.UserDao;
import www.yfz.entity.User;

public class UserService {
    
    public boolean login(String username,String password){
    	UserDao userdao=new UserDao();
    	User user= userdao.getuserByuserName(username);
    	if(StringUtils.isNullOrEmpty(user.getUsername())){
    		return false;
    	}
    	if(!user.getPassword().equals(password)){
    		return false;
    	}
		return true;
    	
    }
    
    /**
     * 获得用户列表
     * @return
     */
    public List<User> getUserList(){
    	UserDao userdao=new UserDao();
    	return userdao.getUserList();
    }
}
